import time

import cv2 as cv


def main():
    img1 = cv.imread('../data/test.png')
    e1 = cv.getTickCount()

    for i in range(5, 49, 2):
        img1 = cv.medianBlur(img1, i)

    e2 = cv.getTickCount()
    t = (e2 - e1) / cv.getTickFrequency()

    print(t, 's')

    t1 = time.time()
    e1 = cv.getTickCount()

    for i in range(5, 49, 2):
        img1 = cv.medianBlur(img1, i)

    e2 = cv.getTickCount()
    tt = (e2 - e1) / cv.getTickFrequency()
    t2 = time.time()
    t = t2 - t1

    print(tt, 's', tt * 1000, 'ms')
    print(t, 's', t * 1000, 'ms')


if __name__ == "__main__":
    main()
